<?
   require_once('config.php');
   $keyword = getValue('q','str','GET','');
   $sql = "SELECT * FROM authors WHERE aut_name LIKE :name";
   $db = new DB();
   $value = array('name' => '%'.$keyword.'%');
   $result = $db->query($sql,$value);
   $token = array();
   if(count($result) > 0){
      foreach($result as $item){
         $token[] = array('id' => $item['aut_id'],'name' => $item['aut_name']);
      }
   }
     
   echo json_encode($token);
?>